<template>
  <div class="container">
    <el-dialog
      title="订单详情"
      :visible.sync="particularsDialogs.centerDialogVisible"
      @open="getData"
      center
      width="1200px"
    >
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="goods_name"
          label="商品名"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="erp_goods_code"
          label="商品编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="spec"
          label="规格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="cost_price"
          label="参考价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="markup"
          label="加价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="withholding_fee"
          label="预提费"
          align="center"
        ></el-table-column>

        <el-table-column
          prop="order_price"
          label="订单价格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="order_num"
          label="订单数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="order_amount"
          label="订单总额"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="qty"
          label="件数"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="warehouse_name"
          label="仓库"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="warehouse_code"
          label="仓库编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="rdc_name"
          label="配送中心"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="rdc_code"
          label="配送中心编码"
          align="center"
        ></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getSaleOrderInfo } from "@/api/middleorder/middleorderlist";
export default {
  props: {
    particularsDialogs: Object,
  },
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    confirm() {
      this.particularsDialogs.centerDialogVisible = false;
    },
    getData() {
      let data = {
        id: this.particularsDialogs.id,
      };
      getSaleOrderInfo(data).then((res) => {
        if (res.code == 0) {
          this.tableData = res.data.info.goods;
        }
      });
    },
    //每页多少条
    handleCurrentChange(val) {
      this.pageData.page = 1;
      this.pageData.pageSize = val;
      this.getData();
    },
    //选取页数
    handleSizeChange(page) {
      this.pageData.page = page;
      this.getData();
    },
  },
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>